+-------------------+----------------------------------------------------------+ | Hacking Sprites | This guide will show you how to hack certain properties | +-------------------+ about the sprites of Bionic Commando. Sprites include | | Dean Tersigni | bullets, enemies, ego, etc. Basically, anything that | +-------------------+ moves. You will be able to change the graphics used, the | | Created: 03/25/03 | palette used, the tile mirroring, and the full structure | | Updated: 04/08/03 | of the sprite. Yee-ha! | +-------------------+----------------------------------------------------------+ The structures of the sprites start at around 284B3, with the normal bullet. (This may not be exact, but it's a good starting point.) You may notice a slight pattern in the hex values in that area. Thanks to the horribly compressed structures, The sprite data is stored in the following way: The first byte is the number of tiles in the sprite. For every tile, there are four bytes of data. So if a sprite was composed of only one tile (like the bulette) it would be five bytes (1 + 4 = 5), but if the sprite was composed of three tiles, it would take 13 bytes. (1 + 4 + 4 + 4 = 13). +------------------------------------------------------------------------------+ | Sprite Structure | +------------------------------------------------------------------------------+ | Number of tiles 1 byte | | ... H Mirror | | Tile offset 1 byte (+20871) | V Mirror | | X offset 1 byte | | Priority | | Y offset 1 byte | | | Palette | | Effects 1 byte 0:0:0:000:00 ------- Effects Byte | | ... | +------------------------------------------------------------------------------+ NOTE: There is sometimes some extra data after some of the sprites, but I'm not sure what it is used for, or how to determine when the data is there. You will no doubt see what I mean when you start working with the data. It sometimes effects the pointer to how the sprite shows up, but I can't get a lock on it. If you figure it out, please contact me. -------------------------------------------------------------------------------- For example, the bullet which is stored at 284B3 has a first byte of 01. This means that there is only 1 tile to this sprite. The next byte is a 91, which is an offset to the tile data which starts at 20871. The tile data can easily be viewed with the program TLayer. The next two bytes include the X and Y offset of the tile from center of the object when it's displayed in the game. You can adjust these to move the tile around. The last byte is the effect byte. The effect byte covers mirroring (horizontal and vertical), as well as priority and palettes. To alter the effects see below. The byte has 8 bits (duh) each bit effects the display of the tile. Effects byte bits - 12345678 Bit 1 - Horizontal mirroring - Flips the image horizontally Bit 2 - Vertical mirroring - Flips the image vertically Bit 3 - Priority - Puts the images behind the background tiles Bit 4 - Unknown - Bit 5 - Unknown - Bit 6 - Unknown - Bit 7 - Palette - There are four palettes to choose from, Bit 8 - Palette - 00, 01, 10, 11. Pick which one you like HACKING EXAMPLE To get you started, here is a quick walk through on hacking the sprites. First pick a sprite you want to edit. I choose the bullet. Then, think about what you want to do to it. In this case, I'm changing it into a head! Find the bullet's sprite offset in the list. (284B3) The current data reads: 01 91 F8 F8 01 We know to stop after only 5 bytes because the first byte (01) tells us how many tiles there are. 91 is the offset in the tile data. We can assume that 91 is the bullet tile. But we don't want that tile, we want the head, which is tile 87. So change the 91 to 86. Now the gun will shoot a head. But wait! The palette of the bullet is green, and a head is not supposed to be green (well not normally). We need to change the palette as well. So look at the effects byte which is 01. We don't need to worry about mirroring now, all we want is to change the palette. The correct palette for the head is palette 00. Change the effects byte to match, and save the ROM. When you go to play the game, you should be shooting heads instead of bullets. -------------------------------------------------------------------------------- Below is the master list of every sprite in the game. Feel free to add to it any missing data. Sprite Master List -------------------------------------------------------------------------------- Offset Description 284B3 - Bullet / Flare 284B8 - Rocket / POW 284C9 - Circle? 284CE - ??? 284DF - Enemy Soldier Idle ... 2A629 - Bullet canister 2A62E - Parachute package ... -------------------------------------------------------------------------------- Last Words: I'm sure there are still a few things I'm missing. For example, I doubt that the current tile offset is complete. It seems doubtful that there are only 256 tiles used in all the sprites in the game. I'm sure I'll figure it out as I get further down the list of sprites. When I find it, I'll update the info. Dean Tersigni (aka The Almighty Guru) www.thealmightyguru.com thealmightyguru@gmail.com Copyright, Dean Tersigni 2003.